<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTransfersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('transfers', function (Blueprint $table) {
            $table->increments('id')->comment('转移ID');
            $table->unsignedInteger('from_user_id')->comment('转移自');
            $table->unsignedInteger('to_user_id')->comment('转移至');
            $table->unsignedDecimal('number', 20, 8)->comment('转移数量');
            $table->timestamp('time')->nullable()->useCurrent()->comment('时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('transfers');
    }
}
